<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/12/21 0021
  Time: 15:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<head>
    <title>修改状态</title>
</head>
<body>
<script>
    function CheckStauteProduct(){
        progressLoad();
        var statusType=$("#statusType").val();
        var productId=$("#productId").val()
        $.ajax({
            cache: true,
            type: "POST",
            url:"${path }/product/checkStauteProduct.do",
            data:{"status":statusType,"productId":productId},
            async: false,
            error: function(request) {
                progressClose();
                $.messager.alert("删除失败", "服务器连接失败!","error");
            },
            success: function(data) {
                progressClose();
                if (data.success) {
                    $.messager.alert("系统提示", "操作成功","info",function(){
                        closeWin('modelCheckStauteProduct');
                        reloadpProductDataGrid();
                    });

                }else{
                    progressClose();
                    $.messager.alert("系统提示", data.msg,"error");
                }
            }
        });
    }
</script>
<style>
    .table td{
        text-align: center;
        height:30px;
        border:1px solid #e0e0e0;
    }
</style>
<table class="table" style="align-content: center">
    <tr>
        <td colspan="2" >启用产品|禁用产品</td>
    </tr>
    <tr >
        <td style="  background-color:  rgb(242,242,242);" >修改状态:</td>
        <td id="productInputs" style="width: 228px">
            <span>禁用:</span><input name="status" value="0" class="" type="radio">
            <span>启用:</span><input name="status" value="1" class="" type="radio">
        </td>
    </tr>
</table>
<input type="hidden" value="${product.id}" id="productId">
<input type="hidden" value="${product.status}" id="statusType">
<script type="text/javascript">
    $(function(){
        $("#productInputs input:eq(${product.status})").attr("checked","checked");
        $("#productInputs input").on("change",function () {
            $("#statusType").val($(this).val());
        });
    })
</script>
<div  data-options="region:'south',border:true" style="height: 24px; padding-top: 8px;text-align: center" >
    <a  class="easyui-linkbutton" icon="icon-save" onclick="CheckStauteProduct()" >保存</a>
    <a  class="easyui-linkbutton" icon="icon-cancel" onclick="closeWin('modelCheckStauteProduct')" >取消</a>
</div>

</body>
</html>
